/* dinfo.h for !DiscEx */

/* this is what a disc record looks like */

typedef struct {
  char log2secsize;
  char secspertrack;
  char heads;
  char density;
  char idlen;
  char log2bpmb;
  char skew;
  char bootoption;
  char lowsector;
  char nzones;
  char zonespare[2];
  unsigned root;
  unsigned discsize;
  char discid[2];
  char discname[10];
  unsigned disctype;
  unsigned discsize2;             /* new field for "big discs" */
  char shareshift;                /* new field for "very big discs" */
} DiscRecordRec, *DiscRecordPtr;

/* the "disc information" structure */

typedef struct {
    DiscRecordRec dr;

  /* derived data */
    char discname[11];
    int secsize;
    int allocsize;
    int secsperdisc;
    double discsize;
    int zonespare;
    int discid;
    int idsperzone;
    int maxfrags;
    unsigned mapaddr;    /* in sectors */
    Bool bigdisc;     /* TRUE iff discsize >= 2^29 bytes */
    int zonesize;     /* in allocation units */
    int zone0size;    /* in allocation units */
    int lastzonesize; /* in allocation units (excl. any final frag 1) */
    int minfragsize;  /* minimum fragment size in sectors */
    int allocunit;    /* minimum fragment extension size (sectors) */
    int shareunit;    /* internal granularity of sharing (sectors) */
    int FS_DiscOp;
    int FS_BigDiscOp;

  /* These are set explicitly for a floppy disc (assumed to be E-format); for
     a hard disc, they are determined from the map itself, taking account of
     any section mapped out by a fragment id = 1 at the end of the map */
    unsigned riscosdiscsize;    /* in sectors */
    int lastzonemapend;         /* one greater than offset of the bit
                                      representing the final block of the
                                      disc in the last map block */
} DiscInfoRec, *DiscInfoPtr;


extern Bool dinfo_request
(
    int code,
    ToolboxEvent *event,
    IdBlock *idblock,
    void *handle
);
extern error * dinfo_getinfo
(
    int FS,
    int drive,
    Bool refresh,
    DiscInfoPtr *info
);
extern error * dinfo_freeinfo
(
    DiscInfoPtr info
);
